package com.jmemoir.orm.mybatisplus.service.impl;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.jmemoir.orm.mybatisplus.entity.SysUser;
import com.jmemoir.orm.mybatisplus.mapper.SysUserMapper;
import com.jmemoir.orm.mybatisplus.service.SysUserService;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 用户接口-实现类
 *
 * @author Tellsea
 * @date 2023/8/4
 */
@Service
@RequiredArgsConstructor
public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> implements SysUserService {

    private final SysUserMapper sysUserMapper;

    @Override
    public Page<SysUser> queryPage(SysUser entity) {
        return sysUserMapper.queryList(new Page<>(entity.getPageNum(), entity.getPageSize()), entity);
    }

    @Override
    public List<SysUser> queryList(SysUser entity) {
        return sysUserMapper.queryList(entity);
    }

    @Override
    public SysUser getById(Long id) {
        return sysUserMapper.getById(id);
    }
}
